package com.qdxwx.data.service.area;


import com.qdxwx.models.area.Area;
import com.qdxwx.models.area.AreaFull;
import com.qdxwx.models.dto.NodeSmall;

import java.util.Collection;

/**
 * Qdx NetSchool Platform
 * @author qdxwx
 * @updateTime 2022/5/25
 * @description
 */

public interface AreaService {

    AreaFull getAreaFull(int areaId);

    Area get(int id);

    Area getParent(int id);

    Collection<Area> getChildren(int id);

    Collection<Area> getAncestors(int id, boolean withSelf);

    Collection<Area> getDescendants(int id, boolean withSelf);

    Collection<Integer> getDescendantIds(int id);

    NodeSmall[] getAreaTreeNode(int parentId, int depth, int withRoot, int withAllChina);

    boolean containsChild(int parentId, String childName);

    int save(Area area);

    int delete(int id);
}
